@extends('public.dashboard_base')
@section('title', '域名归纳')
@section('content')
    <style>
        input[type="email"], input[type="password"], input[type='text'], input[type='number'] {
            height: 38px;
            line-height: 1.3;
            padding-left: 10px;
        }
    </style>
    <div class="control_panel_content" style="margin-bottom: 300px">
        <div class="navBreadcrumb">
            <ul>
                <li>管理员菜单</li>
                <li><a href="">域名归纳</a></li>
            </ul>
        </div>
        <div class="panel">
            <div class="sub_nav_container" style="margin-bottom: 20px">
                <ul class="clearfix">
                    <li class="active"><a href="/member/manager/domain/induce">域名归纳</a></li>
                    <div class="layui-btn-group" style="float: right;margin-right: 50px">
                        <button class="layui-btn layui-btn-normal" id="upload_excel">
                            <i class="layui-icon"></i>上传文件
                        </button>
                        <button class="layui-btn" data-type="view_import">导入状态</button>
                        <div class="layui-progress" lay-filter="upload_bar">
                            <div class="layui-progress-bar" lay-percent="0%" style="width: 100%;"></div>
                        </div>
                    </div>

                </ul>

            </div>

            <div class="demoTable layui-form layui-form-pane">
                {{--            域名              --}}
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">域名</label>
                        <div class="layui-input-inline">
                            <input type="text" name="domain" id="domain" placeholder="请输入域名" autocomplete="off"
                                   class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">后缀</label>
                        <div class="layui-input-inline">
                            <select name="base_suffix">
                                <option value="">全部</option>
                                <option value=".com">.com</option>
                                <option value=".net">.net</option>
                                <option value=".net.cn">.net.cn</option>
                                <option value=".com.cn">.com.cn</option>
                                <option value=".org.cn">.org.cn</option>
                                <option value=".cn">.cn</option>
                                <option value=".cc">.cc</option>
                                <option value=".tv">.tv</option>
                                <option value=".vip">.vip</option>
                                <option value=".top">.top</option>
                                <option value=".org">.org</option>
                                <option value="省级" disabled>以下省级</option>
                                <option value=".jl.cn">.jl.cn</option>
                                <option value=".xz.cn">.xz.cn</option>
                                <option value=".sc.cn">.sc.cn</option>
                                <option value=".hi.cn">.hi.cn</option>
                                <option value=".gz.cn">.gz.cn</option>
                                <option value=".nx.cn">.nx.cn</option>
                                <option value=".jx.cn">.jx.cn</option>
                                <option value=".cq.cn">.cq.cn</option>
                                <option value=".tw.cn">.tw.cn</option>
                                <option value=".sx.cn">.sx.cn</option>
                                <option value=".tj.cn">.tj.cn</option>
                                <option value=".js.cn">.js.cn</option>
                                <option value=".gs.cn">.gs.cn</option>
                                <option value=".fj.cn">.fj.cn</option>
                                <option value=".sd.cn">.sd.cn</option>
                                <option value=".sn.cn">.sn.cn</option>
                                <option value=".gd.cn">.gd.cn</option>
                                <option value=".he.cn">.he.cn</option>
                                <option value=".sh.cn">.sh.cn</option>
                                <option value=".ha.cn">.ha.cn</option>
                                <option value=".hb.cn">.hb.cn</option>
                                <option value=".xj.cn">.xj.cn</option>
                                <option value=".ln.cn">.ln.cn</option>
                                <option value=".ah.cn">.ah.cn</option>
                                <option value=".hk.cn">.hk.cn</option>
                                <option value=".hn.cn">.hn.cn</option>
                                <option value=".gx.cn">.gx.cn</option>
                                <option value=".zj.cn">.zj.cn</option>
                                <option value=".bj.cn">.bj.cn</option>
                                <option value=".qh.cn">.qh.cn</option>
                                <option value=".nm.cn">.nm.cn</option>
                                <option value=".ac.cn">.ac.cn</option>
                                <option value=".hl.cn">.hl.cn</option>
                                <option value=".yn.cn">.yn.cn</option>
                                <option value=".mo.cn">.mo.cn</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">域名状态</label>
                        <div class="layui-input-inline">
                            <select name="base_status">
                                <option value=""> 全部</option>
                                <option value="ok">ok</option>
                                <option value="addPeriod">addPeriod</option>
                                <option value="clientDeleteProhibited">clientDeleteProhibited</option>
                                <option value="clientHold">clientHold</option>
                                <option value="clientRenewProhibited">clientRenewProhibited</option>
                                <option value="clientTransferProhibited">clientTransferProhibited</option>
                                <option value="clientUpdateProhibited">clientUpdateProhibited</option>
                                <option value="inactive">inactive</option>
                                <option value="pendingDelete">pendingDelete</option>
                                <option value="pendingTransfer">pendingTransfer</option>
                                <option value="pendingVerification">pendingVerification</option>
                                <option value="redemptionPeriod">redemptionPeriod</option>
                                <option value="serverDeleteProhibited">serverDeleteProhibited</option>
                                <option value="serverHold">serverHold</option>
                                <option value="serverRenewProhibited">serverRenewProhibited</option>
                                <option value="serverTransferProhibited">serverTransferProhibited</option>
                                <option value="serverUpdateProhibited">serverUpdateProhibited</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <button type="submit" class="layui-btn" data-type="search" lay-submit="" lay-filter="search">
                            搜索
                        </button>
                        {{--                            <button type="submit" class="layui-btn" data-type="search" lay-submit="" lay-filter="search">搜索</button>--}}
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">删除类型</label>
                        <div class="layui-input-inline">
                            <select name="base_delete_type" style="width: 150px;">
                                <option value="">全部</option>
                                <option value="bz-pre">bz-pre</option>
                                <option value="detele">detele</option>
                                <option value="drop-pre">drop-pre</option>
                                <option value="gd-pre">gd-pre</option>
                                <option value="jm-pre">jm-pre</option>
                                <option value="name-pre">name-pre</option>
                                <option value="netcn-pre">netcn-pre</option>
                                <option value="other-pre">other-pre</option>
                                <option value="pre">pre</option>
                                <option value="sna-pre">sna-pre</option>
                                <option value="xb-pre">xb-pre</option>
                                <option value="xw-pre">xw-pre</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">删除日期</label>
                        <div class="layui-input-inline">
                            <div class="layui-input-inline">
                                <input type="text" name="base_delete_day__date" id="base_delete_day" placeholder="选择日期"
                                       autocomplete="off" class="layui-input">
                            </div>
                        </div>
                    </div>
                </div>
                {{--                备案               --}}
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">单位性质</label>
                        <div class="layui-input-inline">
                            <select name="icp_type">
                                <option value="">全部</option>
                                <option value="个人">个人</option>
                                <option value="企业">企业</option>
                                <option value="事业单位">事业单位</option>
                                <option value="司法鉴定机构">司法鉴定机构</option>
                                <option value="国防机构">国防机构</option>
                                <option value="基金会">基金会</option>
                                <option value="外国在华文化中心">外国在华文化中心</option>
                                <option value="外国机构">外国机构</option>
                                <option value="宗教团体">宗教团体</option>
                                <option value="律师执业机构">律师执业机构</option>
                                <option value="政府机关">政府机关</option>
                                <option value="民办非企业">民办非企业</option>
                                <option value="民办非企业单位">民办非企业单位</option>
                                <option value="社会团体">社会团体</option>
                                <option value="群众性团体组织">群众性团体组织</option>
                                <option value="其他(--)">其他(--)</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">备案地区</label>
                        <div class="layui-input-inline">
                            <select name="icp_region">
                                <option value="">全部</option>
                                <option value="上海市">上海市</option>
                                <option value="云南省">云南省</option>
                                <option value="内蒙古自治区">内蒙古自治区</option>
                                <option value="北京市">北京市</option>
                                <option value="吉林省">吉林省</option>
                                <option value="四川省">四川省</option>
                                <option value="天津市">天津市</option>
                                <option value="宁夏回族自治区">宁夏回族自治区</option>
                                <option value="安徽省">安徽省</option>
                                <option value="山东省">山东省</option>
                                <option value="山西省">山西省</option>
                                <option value="广东省">广东省</option>
                                <option value="广西壮族自治区">广西壮族自治区</option>
                                <option value="新疆维吾尔自治区">新疆维吾尔自治区</option>
                                <option value="江苏省">江苏省</option>
                                <option value="江西省">江西省</option>
                                <option value="河北省">河北省</option>
                                <option value="河南省">河南省</option>
                                <option value="浙江省">浙江省</option>
                                <option value="海南省">海南省</option>
                                <option value="湖北省">湖北省</option>
                                <option value="湖南省">湖南省</option>
                                <option value="甘肃省">甘肃省</option>
                                <option value="福建省">福建省</option>
                                <option value="西藏自治区">西藏自治区</option>
                                <option value="贵州省">贵州省</option>
                                <option value="辽宁省">辽宁省</option>
                                <option value="重庆市">重庆市</option>
                                <option value="陕西省">陕西省</option>
                                <option value="青海省">青海省</option>
                                <option value="黑龙江省">黑龙江省</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">备案状态</label>
                        <div class="layui-input-inline">
                            <select name="icp_status">
                                <option value="">全部</option>
                                <option value="1">当前存在</option>
                                <option value="2">历史存在</option>
                                <option value="0">空白</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">注册年龄</label>
                        <div class="layui-input-inline">
                            <div class="layui-input-inline" style="width: 41%;">
                                <input type="text" name="base_reg_age_min" autocomplete="off" placeholder="不限"
                                       class="layui-input">
                            </div>
                            <div class="layui-form-mid">-</div>
                            <div class="layui-input-inline" style="width: 41%;">
                                <input type="text" name="base_reg_age_max" autocomplete="off" placeholder="不限"
                                       class="layui-input">
                            </div>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">可用天数</label>
                        <div class="layui-input-inline">
                            <div class="layui-input-inline" style="width: 41%;">
                                <input type="text" name="base_available_day_min" autocomplete="off" placeholder="不限"
                                       class="layui-input">
                            </div>
                            <div class="layui-form-mid">-</div>
                            <div class="layui-input-inline" style="width: 41%;">
                                <input type="text" name="base_available_day_max" autocomplete="off" placeholder="不限"
                                       class="layui-input">
                            </div>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">是否老域名</label>
                        <div class="layui-input-inline">
                            <select name="base_old">
                                <option value="">全部</option>
                                <option value="1">是</option>
                                <option value="0">否</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">批量备案</label>
                        <div class="layui-input-inline">
                            <select name="icp_multi">
                                <option value="">全部</option>
                                <option value="1">是</option>
                                <option value="0">否</option>
                            </select>
                        </div>
                    </div>
                </div>
                {{--                注册时间 到期时间 备案时间               --}}
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">备案时间</label>
                        <div class="layui-input-inline">
                            <div class="layui-input-inline">
                                <input type="text" name="icp_audit_time__data" id="icp_audit_time" placeholder="选择日期"
                                       autocomplete="off" class="layui-input">
                            </div>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">注册时间</label>
                        <div class="layui-input-inline">
                            <div class="layui-input-inline">
                                <input type="text" name="base_reg_day__date" id="base_reg_day" placeholder="选择日期"
                                       autocomplete="off" class="layui-input">
                            </div>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">到期时间</label>
                        <div class="layui-input-inline">
                            <div class="layui-input-inline">
                                <input type="text" name="base_end_day__date" id="base_end_day" placeholder="选择日期"
                                       autocomplete="off" class="layui-input">
                            </div>
                        </div>
                    </div>
                </div>
                {{--                收入量               --}}
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">百度收入量</label>
                        <div class="layui-input-inline">
                            <div class="layui-input-inline" style="width: 41%;">
                                <input type="text" name="baidu_included_min" autocomplete="off" placeholder="不限"
                                       class="layui-input">
                            </div>
                            <div class="layui-form-mid">-</div>
                            <div class="layui-input-inline" style="width: 41%;">
                                <input type="text" name="baidu_included_max" autocomplete="off" placeholder="不限"
                                       class="layui-input">
                            </div>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">搜狗收入量</label>
                        <div class="layui-input-inline">
                            <div class="layui-input-inline" style="width: 41%;">
                                <input type="text" name="sougou_shourushu_min" autocomplete="off" placeholder="不限"
                                       class="layui-input">
                            </div>
                            <div class="layui-form-mid">-</div>
                            <div class="layui-input-inline" style="width: 41%;">
                                <input type="text" name="sougou_shourushu_max" autocomplete="off" placeholder="不限"
                                       class="layui-input">
                            </div>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">360收入量</label>
                        <div class="layui-input-inline">
                            <div class="layui-input-inline" style="width: 41%;">
                                <input type="text" name="360_included_min" autocomplete="off" placeholder="不限"
                                       class="layui-input">
                            </div>
                            <div class="layui-form-mid">-</div>
                            <div class="layui-input-inline" style="width: 41%;">
                                <input type="text" name="360_included_max" autocomplete="off" placeholder="不限"
                                       class="layui-input">
                            </div>
                        </div>
                    </div>
                </div>
                {{--                官网                 --}}
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">百度官网</label>
                        <div class="layui-input-inline">
                            <select name="baidu_official">
                                <option value="">全部</option>
                                <option value="1">是</option>
                                <option value="0">否</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">搜狗官网</label>
                        <div class="layui-input-inline">
                            <select name="sougou_official">
                                <option value="">全部</option>
                                <option value="1">是</option>
                                <option value="0">否</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">360官网</label>
                        <div class="layui-input-inline">
                            <select name="360_official">
                                <option value="">全部</option>
                                <option value="1">是</option>
                                <option value="0">否</option>
                            </select>
                        </div>
                    </div>
                </div>
                {{--                反向链接                 --}}
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">百度反链</label>
                        <div class="layui-input-inline">
                            <div class="layui-input-inline" style="width: 41%;">
                                <input type="text" name="baidu_re_link_min" autocomplete="off" placeholder="不限"
                                       class="layui-input">
                            </div>
                            <div class="layui-form-mid">-</div>
                            <div class="layui-input-inline" style="width: 41%;">
                                <input type="text" name="baidu_re_link_max" autocomplete="off" placeholder="不限"
                                       class="layui-input">
                            </div>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">高权重5+</label>
                        <div class="layui-input-inline">
                            <div class="layui-input-inline" style="width: 41%;">
                                <input type="text" name="baidu_high_weight_5_min" autocomplete="off" placeholder="不限"
                                       class="layui-input">
                            </div>
                            <div class="layui-form-mid">-</div>
                            <div class="layui-input-inline" style="width: 41%;">
                                <input type="text" name="baidu_high_weight_5_max" autocomplete="off" placeholder="不限"
                                       class="layui-input">
                            </div>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">Gov外链</label>
                        <div class="layui-input-inline">
                            <div class="layui-input-inline" style="width: 41%;">
                                <input type="text" name="baidu_gov_min" autocomplete="off" placeholder="不限"
                                       class="layui-input">
                            </div>
                            <div class="layui-form-mid">-</div>
                            <div class="layui-input-inline" style="width: 41%;">
                                <input type="text" name="baidu_gov_max" autocomplete="off" placeholder="不限"
                                       class="layui-input">
                            </div>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">Edu外链</label>
                        <div class="layui-input-inline">
                            <div class="layui-input-inline" style="width: 41%;">
                                <input type="text" name="baidu_edu_min" autocomplete="off" placeholder="不限"
                                       class="layui-input">
                            </div>
                            <div class="layui-form-mid">-</div>
                            <div class="layui-input-inline" style="width: 41%;">
                                <input type="text" name="baidu_edu_max" autocomplete="off" placeholder="不限"
                                       class="layui-input">
                            </div>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">搜狗反链</label>
                        <div class="layui-input-inline">
                            <div class="layui-input-inline" style="width: 41%;">
                                <input type="text" name="sougou_re_link_min" autocomplete="off" placeholder="不限"
                                       class="layui-input">
                            </div>
                            <div class="layui-form-mid">-</div>
                            <div class="layui-input-inline" style="width: 41%;">
                                <input type="text" name="sougou_re_link_max" autocomplete="off" placeholder="不限"
                                       class="layui-input">
                            </div>
                        </div>
                    </div>
                </div>
                {{--                自持                 --}}
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">是否自持</label>
                        <div class="layui-input-inline">
                            <select name="self_self">
                                <option value="">全部</option>
                                <option value="1">是</option>
                                <option value="0">否</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">成本</label>
                        <div class="layui-input-inline">
                            <div class="layui-input-inline" style="width: 41%;">
                                <input type="text" name="self_price_min" autocomplete="off" placeholder="不限"
                                       class="layui-input">
                            </div>
                            <div class="layui-form-mid">-</div>
                            <div class="layui-input-inline" style="width: 41%;">
                                <input type="text" name="self_price_max" autocomplete="off" placeholder="不限"
                                       class="layui-input">
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            {{--            工具栏按钮--}}
            <script type="text/html" id="toolbar">
                <div class="layui-btn-container">
                    @foreach($condition_name as $key=>$item)
                        @if($item->back_end == true)
                            <button class="layui-btn layui-btn-sm" lay-event="{{$item->name}}">{{$item->name}}<span
                                        class="{{$item->name}} "></span>
                            </button>
                        @endif

                    @endforeach
                    <button class="layui-btn layui-btn-sm layui-btn-danger" lay-event="condition">显示属性<span
                                class="e_group"></span></button>
                </div>
            </script>
            <table id="table" lay-filter="table"></table>


        </div>

    </div>
@endsection
@section('script')
    <script type="text/javascript" src="/static/js/laydate.js"></script>
    <script>

        $(function () {
            var link = $("#manager_domain_induce");
            link.parent().parent().parent().addClass("active");
            link.parent().addClass("active");
        });

        //上传文件
        layui.upload.render({ //允许上传的文件后缀
            elem: '#upload_excel'
            , headers: {'X-CSRF-TOKEN': '{{csrf_token()}}'}
            , url: 'induce/upload' //改成您自己的上传接口
            , accept: 'file' //普通文件
            , exts: 'xlsx' //只允许上传压缩文件
            , done: function (res) {
                $.get("induce/import", function (data, status) {
                    if (status === 'success') {
                        layer.msg(data)
                    }
                });
                layer.closeAll('loading'); //关闭loading
            }
            , before: function (obj) {
                layui.element.progress('upload_bar', '0' + '%');
                layer.load();
            }
            , progress: function (n, elem) {
                var percent = n + '%';
                layui.element.progress('upload_bar', percent);
            }
            , error: function (index, upload) {
                layer.closeAll('loading'); //关闭loading
            }
        });
        //表格
        tableChange('{{ request()->get('group_name','后端')}}');

        //日期
        layui.laydate.render({
            elem: '#base_delete_day'
            , range: true
        });
        layui.laydate.render({
            elem: '#base_reg_day'
            , range: true
        });
        layui.laydate.render({
            elem: '#base_end_day'
            , range: true
        });
        layui.laydate.render({
            elem: '#icp_audit_time'
            , range: true
        });
        //监听单元格编辑
        layui.table.on('edit(table)', function (obj) {
            $.ajax({
                url: '/member/manager/domain/induce/save',
                type: "post",
                data: {'_token': '{{csrf_token()}}', 'data': obj.data},
                success: function (data) {
                    if (data.msg === 'success') {
                        layer.msg('成功', {icon: 1, time: 500}, function () {

                        })
                    } else {
                        layer.msg(data.msg, {icon: 2});
                    }
                },
                error: function (xhr, Status, error) {
                    layer.msg(Status + ':' + xhr.responseJSON.data, {icon: 2});
                }
            });
        });
        //监听搜索按钮
        // var $ = layui.$, active = {
        var active = {
            // search: function () {
            //     layui.table.reload('id_table', {
            //         where: { //设定异步数据接口的额外参数，任意设
            //             domain: $('#domain').val()
            //             , status: $('#search_status').val()
            //             // key: {
            //             //     email: $('#search_email').val()
            //             // }
            //         }
            //         , page: {
            //             curr: 1 //重新从第 1 页开始
            //         }
            //     }); //只重载数据
            // },
            view_import: function () {
                layer.open({
                    type: 2,
                    title: '导入状态',
                    shadeClose: true,
                    shade: 0.8,
                    area: ['400px', '300px'],
                    content: 'induce/import/status',
                    end: function () {
                    }
                });

            }
        };

        $('.layui-btn').on('click', function () {
            var type = $(this).data('type');
            active[type] ? active[type].call(this) : '';
        });
        //监听提交
        layui.form.on('submit(search)', function (data) {

            console.log(data.field);
            layui.table.reload('id_table', {
                where: { //设定异步数据接口的额外参数，任意设
                    //domain: $('#domain').val()
                    domain: data.field.domain
                    , data: data.field
                    // key: {
                    //     email: $('#search_email').val()
                    // }
                }
                , page: {
                    curr: 1
                }
            });
            return false;
        });


        //监听工具栏事件
        layui.table.on('toolbar(table)', function (obj) {
            switch (obj.event) {
                @foreach($condition_name as $key=>$item)
                @if($item->back_end == true)
                case '{{$item->name}}':
                    window.location.href = 'induce?group_name={{$item->name}}';
                    break;
                @endif
                @endforeach
                case 'condition':
                    layer.open({
                        type: 2,
                        title: '显示属性',
                        shadeClose: true,
                        shade: 0.8,
                        area: ['960px', '800px'],
                        content: '/member/manager/domain/induce/condition',
                        end: function () {
                            //layui.table.reload('id_table')
                            window.location.reload();
                        }
                    });
                    break;
            }
        });


        //table change
        function tableChange(group_name) {
            layui.table.render({
                elem: '#table'
                , id: 'id_table'
                //  , toolbar: '#toolbar'
                , url: '/member/manager/domain/induce?group_name=' + group_name //数据接口
                , method: 'POST'
                , headers: {'X-CSRF-TOKEN': '{{csrf_token()}}'}
                , parseData: function (res) { //res 即为原始返回的数据
                    return {
                        "code": res.code, //解析接口状态
                        "msg": res.msg, //解析提示文本
                        "count": res.count, //解析数据长度
                        "data": res.data.data //解析数据列表
                    };
                }
                , page: true //开启分页
                , limit: 10
                , cols: [[ //表头
                    {type: 'checkbox', fixed: 'left'}
                    @foreach($key_name as $item )
                    , {
                        field: '{{$item['key']}}', title: '{{$item['name']}}'
                        @if($item['key']=='id') , width: 70 @endif
                        @if($item['key']=='domain'), minWidth: 200 @endif
                        @if($item['key']!= 'id') , edit: 'text' @endif
                    }
                    @endforeach
                ]]
                , defaultToolbar: [] //'filter', 'exports', 'print'
                , toolbar: '#toolbar'
                , done: function () {
                    $('.' + group_name).addClass('layui-badge-dot');
                }
            });
        }

        //获取选中数据
        function getCheckStatusItem() {
            var checkStatus = layui.table.checkStatus('table');
            var data = checkStatus.data;  //获取选中行数据
            var ids = [];
            $.each(data, function ($key, $el) {
                ids.push($el.id);
            });
            return ids;
        }

    </script>
@endsection
